package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PWxUserMapper;
import com.ruoyi.system.domain.PWxUser;
import com.ruoyi.system.service.IPWxUserService;

/**
 * 微信用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-28
 */
@Service
public class PWxUserServiceImpl implements IPWxUserService 
{
    @Autowired
    private PWxUserMapper pWxUserMapper;

    /**
     * 查询微信用户
     * 
     * @param id 微信用户主键
     * @return 微信用户
     */
    @Override
    public PWxUser selectPWxUserById(Long id)
    {
        return pWxUserMapper.selectPWxUserById(id);
    }

    /**
     * 查询微信用户列表
     * 
     * @param pWxUser 微信用户
     * @return 微信用户
     */
    @Override
    public List<PWxUser> selectPWxUserList(PWxUser pWxUser)
    {
        return pWxUserMapper.selectPWxUserList(pWxUser);
    }

    /**
     * 新增微信用户
     * 
     * @param pWxUser 微信用户
     * @return 结果
     */
    @Override
    public int insertPWxUser(PWxUser pWxUser)
    {
        pWxUser.setCreateTime(DateUtils.getNowDate());
        return pWxUserMapper.insertPWxUser(pWxUser);
    }

    /**
     * 修改微信用户
     * 
     * @param pWxUser 微信用户
     * @return 结果
     */
    @Override
    public int updatePWxUser(PWxUser pWxUser)
    {
        pWxUser.setUpdateTime(DateUtils.getNowDate());
        return pWxUserMapper.updatePWxUser(pWxUser);
    }

    /**
     * 批量删除微信用户
     * 
     * @param ids 需要删除的微信用户主键
     * @return 结果
     */
    @Override
    public int deletePWxUserByIds(Long[] ids)
    {
        return pWxUserMapper.deletePWxUserByIds(ids);
    }

    /**
     * 删除微信用户信息
     * 
     * @param id 微信用户主键
     * @return 结果
     */
    @Override
    public int deletePWxUserById(Long id)
    {
        return pWxUserMapper.deletePWxUserById(id);
    }
}
